﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using FSY.API.Providers;
using FSY.Components.Entities;
using FSY.Globals;
namespace FSY.Components.DataProvider
{
    public abstract class Fsy_DataProvider
    {
        #region Create Provider Instance
        private static Fsy_DataProvider _Instance = null;
        public static Fsy_DataProvider Instance
        {
            get
            {
                if (_Instance == null)
                {
                    _Instance = new Fsy_SqlDataProvider();
                }
                return _Instance;
            }
        }
        #endregion     

        #region Languages
        public abstract int Languages_AddDeleteUpdate(Fsy_Languages languages,DataProviderAction action);
        public abstract List<Fsy_Languages> Language_GetListAll();
        public abstract DataSet Language_GetDataSetAll();
        public abstract Fsy_Languages Language_GetByID(int ID);
        #endregion

        #region Menu
        public abstract int Menu_AddDeleteUpdate(Fsy_Menu menu, DataProviderAction action);
        public abstract List<Fsy_Menu> Menu_GetListAll();
        public abstract DataSet Menu_GetDataSetAll();
        public abstract Fsy_Menu Menu_GetByID(int ID);
        #endregion

        #region MenuModule
        public abstract int MenuModule_AddDeleteUpdate(Fsy_MenuModule menuModule, DataProviderAction action);
        public abstract List<Fsy_MenuModule> MenuModule_GetListAll();
        public abstract DataSet MenuModule_GetDataSetAll();
        public abstract Fsy_MenuModule MenuModule_GetByID(int ID);
        public abstract List<Fsy_MenuModule> MenuModule_GetByMenuID(int menuID);
        #endregion

        #region MenuPermission
        public abstract int MenuPermission_AddDeleteUpdate(Fsy_MenuPermission menuPermission, DataProviderAction action);
        public abstract List<Fsy_MenuPermission> MenuPermission_GetListAll();
        public abstract List<Fsy_MenuPermission> MenuPermission_GetByMenuID(int menuID);
        public abstract DataSet MenuPermission_GetDataSetAll();
        public abstract Fsy_MenuPermission MenuPermission_GetByID(int ID);
        #endregion

        #region MenuTitle
        public abstract int MenuTitle_AddDeleteUpdate(Fsy_MenuTitle menuTitle, DataProviderAction action);
        public abstract List<Fsy_MenuTitle> MenuTitle_GetListAll();
        public abstract DataSet MenuTitle_GetDataSetAll();
        public abstract Fsy_MenuTitle MenuTitle_GetByID(int ID);
        #endregion

        #region Module
        public abstract int ModuleControl_AddDeleteUpdate(Fsy_ModuleControl moduleControle, DataProviderAction action);
        public abstract List<Fsy_ModuleControl> ModuleControl_GetListAll();
        public abstract DataSet ModuleControl_GetDataSetAll();
        public abstract Fsy_ModuleControl ModuleControl_GetByID(int ID);
        #endregion

        #region Portal
        public abstract int Portal_AddDeleteUpdate(Fsy_Portal menu, DataProviderAction action);
        public abstract List<Fsy_Portal> Portal_GetListAll();
        public abstract DataSet Portal_GetDataSetAll();
        public abstract Fsy_Portal Portal_GetByID(int ID);
        #endregion

        #region Role
        public abstract int Role_AddDeleteUpdate(Fsy_Role role, DataProviderAction action);
        public abstract List<Fsy_Role> Role_GetListAll();
        public abstract DataSet Role_GetDataSetAll();
        public abstract Fsy_Role Role_GetByID(int ID);
        public abstract List<Fsy_RoleQuery> Role_GetByUser(int user);
        public abstract List<Fsy_RoleQuery> Role_GetByMenu(int menu);
        public abstract List<Fsy_RoleQuery> Role_GetByModule(int module);
        #endregion

        #region RolePermission
        public abstract int RolePermission_AddDeleteUpdate(Fsy_RolePermission rolePermiss, DataProviderAction action);
        public abstract List<Fsy_RolePermission> RolePermission_GetListAll();
        public abstract DataSet RolePermission_GetDataSetAll();       
        #endregion

        #region Theme
        public abstract int Theme_AddDeleteUpdate(Fsy_Theme theme, DataProviderAction action);
        public abstract List<Fsy_Theme> Theme_GetListAll();
        public abstract DataSet Theme_GetDataSetAll();
        public abstract Fsy_Theme Theme_GetByID(int ID);
        #endregion

        #region User
        public abstract int User_AddDeleteUpdate(Fsy_User user, DataProviderAction action);
        public abstract List<Fsy_User> User_GetListAll();
        public abstract DataSet User_GetDataSetAll();
        public abstract Fsy_User User_GetByID(int ID);
        public abstract List<Fsy_UserQuery> User_GetByRole(int roleID);
        public abstract List<Fsy_UserQuery> User_GetByMenu(int menuID);
        public abstract List<Fsy_UserQuery> User_GetByModule(int moduleID);
        public abstract IDataReader User_GetAll();
        #endregion

        #region UserRole
        public abstract int UserRole_AddDeleteUpdate(Fsy_UserRole userRole, DataProviderAction action);
        public abstract List<Fsy_UserRole> UserRole_GetListAll();
        public abstract DataSet UserRole_GetDataSetAll();
        public abstract Fsy_UserRole UserRole_GetByID(int ID);
        #endregion

    }
}
